{template meta}
<div class="news-header">
  <div class="layui-container">
    <a id="logo" href="{SITE_URL}"><img style="width:90px;height:30px;" src="{$setting['site_logo']}" alt="{$setting['site_name']}"></a>
    <ul class="layui-nav header-nav close">
    
  
                    
      <li class="layui-nav-item {if $regular=='index/index'}layui-this{/if}">
        <a href="{SITE_URL}">首页</a>
      </li>
                           {eval  $catlist=$this->getlistbysql("select id,name,displayorder,grade from ".$this->db->dbprefix."category where iscourse=0 and isusearticle=1 and grade=1 and pid=0 order by displayorder asc  limit 0,100");}
        {if $catlist}
                  <!--{loop $catlist $index $cat}-->
                  {if $index<4}
                    <li class="layui-nav-item {if $pid==$cat['id']||$catid==$cat['id']}layui-this{/if}">
        <a href="{eval echo getcaturl($cat['id'],'seo/index/#id#');}">{$cat['name']}</a>
      </li>
                       {/if}
                                              <!--{/loop}-->
                                             
     {if count($catlist)>4}
      <li class="layui-nav-item more">
        <a href="javaScript:;">更多</a>
        <dl class="layui-nav-child">
                                      <!--{loop $catlist $index $cat}-->
                  {if $index>=4}
                  
          <dd><a class="hida" href="{eval echo getcaturl($cat['id'],'seo/index/#id#');}">{$cat['name']}</a> </dd>
      
         {/if}
            <!--{/loop}-->
        </dl>
      </li>
       {/if}
          {/if}
    </ul>
    <button id="switch">
      <span></span><span class="second"></span><span class="third"></span>
    </button>
    <div class="layui-form header-search">
      <input type="text" placeholder="关键词搜索文章" class="layui-input" id="searchword" value="{$word}">
    </div>
    {if $user['uid']==0}
    <div class="layui-form header-login">
      <a href="{url user/login}">登入</a>
      <a href="{SITE_URL}plugin/qqlogin/index.php"><i class="layui-icon layui-icon-news-qq"></i></a>
      <a href="{url plugin_weixin/openauth}"><i class="layui-icon layui-icon-news-wechat"></i></a>
    </div>
    {else}
    <ul class="layui-nav header-login" >
      <li class="layui-nav-item">
        <a href="javascript:;"><img src="{$user['avatar']}" class="layui-nav-img"></a>
        <dl class="layui-nav-child">

      
           {if $user['groupid']==1}  <dd><a href="{SITE_URL}index.php?admin_main/stat">后台管理</a></dd>{/if}
          <dd><a href="{url user/logout}">退出登录</a></dd>
        </dl>
      </li>
    </ul>
    {/if}
  </div>
</div>
